home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / man / lib.fmt / tcl / Tcl_SplitList.man < prev    next >
Encoding:
Text File  |  1991-05-31  |  2.9 KB  |  135 lines

  1.  
  2.  
  3.  
  4. Tcl_SplitList     Tcl Command Language Library      Tcl_SplitList
  5.  
  6.  
  7.  
  8. _________________________________________________________________
  9.  
  10. NNAAMMEE
  11.      Tcl_SplitList - break a Tcl list up into fields
  12.  
  13. SSYYNNOOPPSSIISS
  14.      ##iinncclluuddee <<ttccll..hh>>
  15.  
  16.      int
  17.      TTccll__SSpplliittLLiisstt(_i_n_t_e_r_p, _l_i_s_t, _a_r_g_c_P_t_r, _a_r_g_v_P_t_r)
  18.  
  19. AARRGGUUMMEENNTTSS
  20.      Tcl_Interp   *_i_n_t_e_r_p    (out)     Interpreter  to  use   for
  21.                                        error reporting.
  22.  
  23.      char         *_l_i_s_t      (in)      Pointer to a  string  with
  24.                                        proper list structure.
  25.  
  26.      int          *_a_r_g_c_P_t_r   (out)     Filled in with  number  of
  27.                                        elements in _l_i_s_t.
  28.  
  29.      char         ***_a_r_g_v_P_t_r (out)     *_a_r_g_v_P_t_r will be filled in
  30.                                        with  the  address  of  an
  31.                                        array of pointers  to  the
  32.                                        strings   that   are   the
  33.                                        extracted   elements    of
  34.                                        _l_i_s_t.    There   will   be
  35.                                        *_a_r_g_c_P_t_r valid entries  in
  36.                                        the array.
  37.  
  38. _________________________________________________________________
  39.  
  40.  
  41. DDEESSCCRRIIPPTTIIOONN
  42.      TTccll__SSpplliittLLiisstt is the inverse of TTccll__MMeerrggee.  Given a list, it
  43.      extracts  all  of  the  elements  of the list and returns an
  44.      array of pointers to them using _a_r_g_c_P_t_r and _a_r_g_v_P_t_r.   While
  45.      extracting  the  arguments,  TTccll__SSpplliittLLiisstt  obeys  the usual
  46.      rules for backslash substitutions and braces.  The  area  of
  47.      memory  pointed to by *_a_r_g_v_P_t_r is dynamically allocated;  in
  48.      addition to the array of pointers, it also holds  copies  of
  49.      all the list elements.  It is the caller's responsibility to
  50.      free up all of this storage by calling
  51.  
  52.           free((char *) *_a_r_g_v_P_t_r)
  53.      when the list elements are no longer needed.
  54.  
  55.      TTccll__SSpplliittLLiisstt normally returns TTCCLL__OOKK, which means the  list
  56.      was  successfully  parsed.   If  there was a syntax error in
  57.      _l_i_s_t, then TTCCLL__EERRRROORR is  returned  and  _i_n_t_e_r_p->_r_e_s_u_l_t  will
  58.      point to an error message describing the problem.
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65. Sprite v.1.0         Printed:  May 31, 1991                     1
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72. Tcl_SplitList     Tcl Command Language Library      Tcl_SplitList
  73.  
  74.  
  75.  
  76. KKEEYYWWOORRDDSS
  77.      list, split, strings
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131. Sprite v.1.0         Printed:  May 31, 1991                     2
  132.  
  133.  
  134.  
  135.